﻿using System;
using System.Collections;



/*
public struct Coordinate
{
    public int x;
    public int y;
}

public class CModify
{
    public static void AttemtToModifyCoord(Coordinate coord)
    {
        coord.x = 1;
        coord.y = 2;
    }

    public static void ModifyCoord(ref Coordinate coord)
    {
        coord.x = 10;
        coord.y = 20;
    }

    static void Main()
    {
        Coordinate location;
        location.x = 0;
        location.y = 0;
        
        AttemtToModifyCoord(location);
        System.Console.WriteLine("{0} , {1}", location.x, location.y);
        
        ModifyCoord(ref location);
        System.Console.WriteLine("{0} , {1}",location.x, location.y);

        System.Console.Read();
    }
 
}

*/


/*
class EntryPoint
{
    static void Main()
    {
        Collection<int> numbers = new Collection<int>();
        numbers.Add(43);
        numbers.Add(42);

        Collection<Collection<int>> colNumbers = new Collection<Collection<int>>();
        colNumbers.Add(numbers);

        IList<int> theNumbers = numbers;

        foreach (int i in theNumbers)
        {
            Console.WriteLine(i);
        }
        Console.ReadLine();
    }
}
*/

/*
public class A
{
    private void SomeOperation()
    {
        x = 1;
        this.y = 2;
        z = 3;
    }

    private int x;
    private int y;
    private static int z;

    static void Main()
    {
        A obj = new A();
        obj.SomeOperation();
        System.Console.WriteLine("x={0},y={1},z={2}",obj.x,obj.y,A.z);
        System.Console.ReadLine();
    }
}
*/

/*
//c88
public abstract class GeometricShape
{
    public abstract void Draw();
}

public class Rectangle : GeometricShape
{
    public override void Draw()
    {
        System.Console.WriteLine("Rectangle.Draw");
    }
}

public class Circle : GeometricShape
{
    public override void Draw()
    {
        System.Console.WriteLine("Circle.Draw");
    }
}

public class Drawing : IEnumerable
{
    private ArrayList shapes;
    private class Iterator : IEnumerator
    {
        public Iterator(Drawing drawing)
        {
            this.drawing = drawing;
            this.current = -1;
        }
        public void Reset()
        {
            current = -1;
        }
        public bool MoveNext()
        {
            ++current;
            if (current < drawing.shapes.Count)
                return true;
            else
                return false;
        }
        public object Current
        {
            get
            {
                return drawing.shapes[current];
            }
        }

        private Drawing drawing;
        private int current;
    }

    public Drawing()
    {
        shapes = new ArrayList();
    }
    public IEnumerator GetEnumerator()
    {
        return new Iterator(this);
    }
    public void Add(GeometricShape shape)
    {
        shapes.Add(shape);
    }
}

public class EntryPoint
{
    static void Main()
    {
        Rectangle rectangle = new Rectangle();
        Circle circle = new Circle();
        Drawing drawing = new Drawing();
        
        drawing.Add(rectangle);
        drawing.Add(circle);

        foreach (GeometricShape shape in drawing)
        {
            shape.Draw();
        }
    }
}
*/

//c106
/*
public class Employee
{
    public string Name { get; set; }
    public string OfficeLocation { get; set; }
}

public class FeutureDevPair
{
    public Employee Developer { get; set; }
    public Employee QAEng { get; set; }
}

public class InitExample
{
    static void Main()
    {
        FeutureDevPair team = new FeutureDevPair
                                  {
                                      Developer = new Employee {Name = "Mark", OfficeLocation = "Londoon"},
                                      QAEng = new Employee {Name = "asf", OfficeLocation = "asd"}
                                  };
    }
}
*/


//c131
/*
public class A : IDisposable
{
    private bool disposed = false;

    private void Dispose(bool disposing)
    {
        if (!disposed)
        {
            if (disposing)
            {
                Console.WriteLine("Safe clean");
            }
            Console.WriteLine("Clean object");
            disposed = true;
        }
    }

    public void Dispose()
    {
        Dispose(true);
        GC.SuppressFinalize(this);
    }

    public void DoSomething()
    {
        Console.WriteLine("Do Something");
    }

    ~A()
    {
        Console.WriteLine("Finalization");
        Dispose(false);
    }

}

public class EntryPoint
{
    static void Main()
    {
       using (A a = new A())
       {
            a.DoSomething();
       }

       using (A a = new A(),  b = new A() )
       {
            a.DoSomething();
            b.DoSomething();
       }

       Console.Read();
    }
}

*/
/*

public interface IUIControl
{
    void Paint();
}

public interface IEditBox : IUIControl
{
     
}

public interface IDropList : IUIControl
{

}

public class ComboBox : IEditBox, IDropList
{
    public void Paint()
    {
        ((IUIControl)this).Paint();
    }
//     void IEditBox.Paint()
//     {
//         Console.WriteLine("ComboBox.IEditBox.Paint()");
//     }    
    void IUIControl.Paint()
    {
        Console.WriteLine("ComboBox.IUIControl.Paint()");
    }
    
}

public class EnttryPoint
{
    static void Main()
    {
        ComboBox cb = new ComboBox();
        cb.Paint();
        ((IEditBox)cb).Paint();
        ((IDropList)cb).Paint();
        ((IUIControl)cb).Paint();

        Console.Read();
    }
}
*/

public interface IMyInterface
{
    void Go();
}
public class A : IMyInterface
{
    public void Go()
    {
        Console.WriteLine("A.Go()");
    }
}
public class B : A
{
    
}
public class C : B, IMyInterface
{
    public /*new*/ void Go()
    {
        Console.WriteLine("C.Go()");
    }
}
public class EntryPOint
{
    static void Main()
    {
        B b1 = new B();
        C c1 = new C();
        B b2 = c1;

        b1.Go();
        c1.Go();
        b2.Go();
        ((IMyInterface)b2).Go();

        Console.Read();
    }
}